<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('dassembly_order', function (Blueprint $table) {
            $table->id()->comment('自增id');
$table->string('docno', 200)->nullable()->unique()->comment('组装拆卸单据编号');
$table->integer('fid')->nullable()->comment('金蝶单据内码');
$table->string('order_type', 20)->comment('装配类型：Dassembly 拆卸，Assembly 组装');
$table->string('org_code', 20)->comment('组织代码');
$table->string('org_name', 50)->comment('组织代码');
$table->integer('material_id')->nullable()->comment('产品id');
$table->decimal('qty')->comment('数量');
$table->string('wms_code', 20)->comment('仓库代码');
$table->string('cargo_code', 20)->comment('货主代码');
$table->string('cargo_name', 100)->comment('货主名称');
$table->tinyInteger('status')->default(0)->comment('单据状态：0待装配，1已调出，2已调入，3装配完成');
$table->creatorId();
$table->createdAt();
$table->updatedAt();
$table->deletedAt();

$table->engine='InnoDB';
$table->comment('组装拆卸单据头');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('dassembly_order');
    }
};
